#include "burnpipe.h"
#include "../group/group.h"
#include "../../threadpool/tp.h"

namespace burn {

GNode::GNode() : GElement() {
  node_type_ = GNodeType::BASIC;
  element_type_ = GElementType::NODE;
  session_ = URandom<>::generateSession(CGRAPH_STR_NODE);
}

CStatus GNode::doParallel(const UTaskGroup &tasks, CMSec ttl) {
  CGRAPH_FUNCTION_BEGIN
  CGRAPH_ASSERT_INIT(true)
  CGRAPH_ASSERT_NOT_NULL(thread_pool_)

  status = thread_pool_->submit(tasks, ttl);
  CGRAPH_FUNCTION_END
}

GNode *GNode::setType(const GNodeType &type) {
  node_type_ = type;
  return this;
}

} // namespace burn